<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>slot</title>
    <script src="https://unpkg.com/vue@next"></script>
</head>

<body>
    <div id="root"></div>
    <script>
        const app = Vue.createApp({
            data() {
                return {
                    jj: 'jsjs'
                }
            },
            template: `<gu v-model='jj'>
                <template v-slot:header> <div>header</div></template>              
                <template v-slot:footer> <div>footer</div></template>
                </gu>`
        })
        app.component('gu', {
            props: ['modelValue'],
            methods: {
                handleClick() {
                    alert(123)
                    this.$emit('update:modelValue', this.modelValue + 'b')
                },
            },
            template: `<input/>
            <span  @click='handleClick'>
            <slot name=header></slot>{{modelValue}}<slot name=footer></slot></span>
            `
        })
        app.mount('#root')
    </script>
</body>

</html>